﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AppService.Model;

namespace WindowsFormsApp.Service
{
    public class DoubleColorBallService
    {
        private static readonly string[] RedArray = new[]
            {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33"};

        private static readonly string[] BlueArray = new[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16" };

        private List<DoubleColorBall> _list {get; set; }

        public DoubleColorBallService(List<DoubleColorBall> list)
        {
             _list=list;
        }

        #region Service

        /// <summary>
        /// 每年同期号的数据
        /// </summary>
        /// <param name="shortIssueNotYear"></param>
        /// <returns></returns>
        public List<DoubleColorBall> EveryIssueOfYear(string shortIssueNotYear)
        {
            var list = _list.Where(x => x.Issue.Substring(4) == shortIssueNotYear).ToList();
            return list;
        }

        /// <summary>
        /// 相同的星期数据
        /// </summary>
        /// <param name="week"></param>
        /// <returns></returns>
        public List<DoubleColorBall> WeekIssue(string week)
        {
            var list = _list.Where(x => x.Week == week).ToList();
            return list;
        }
        #endregion

    }
}
